﻿using FDStudio.Core.Container;
using FDStudio.Core.Runtime;
using Microsoft.Extensions.DependencyInjection;

namespace FDStudio.Core.Extensions.Container
{
    /*
     CreatedOn: 2018-01-26
     CreatedBy: Jackie Lee(天宇遊龍)
     */
    /// <summary>
    /// 使用.net core默认容器
    /// </summary>
    public static class IContainerExtension
    {
        /// <summary>
        /// 构造依赖器
        /// </summary>
        /// <param name="services"></param>
        public static void BuildContainer(this IServiceCollection services)
        {
            RuntimeContext.Current.RegistContainer(new DefaultContainer(services.BuildServiceProvider()));
        }
    }
}
